'use strict';
(!Array.includes) && (Array.prototype.includes = function (key) {
  let self = this;
  if (self.indexOf(key) > -1)
    return true;
  return false;
});

Array.prototype.removal = function () {
  let self = this;
  if (self.length < 2)
    return self;

  let cache = [];
  self
    .sort()
    .forEach((key, index) => {
      key === self[index - 1] || cache.push(key);
    });
  return cache;
};

Array.prototype.has = function () {
  let self = this;
  for (let key in arguments) {
    if (!self.includes(arguments[key])) {
      return false;
    }
  }
  return true;
};

Array.prototype.hasOne = function () {
  let self = this;
  for (let key in arguments) {
    if (self.includes(arguments[key])) {
      return true;
    }
  }
  return false;
};
